package com.lightjet.macross.base.upms.service;

import com.lightjet.macross.base.feign.api.domain.AuthUser;
import com.lightjet.macross.base.upms.domain.SysUser;
import com.lightjet.macross.common.core.BaseService;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface SysUserService extends BaseService<SysUser,String> {
    SysUser FromAuthUser(AuthUser authUser);

    AuthUser ToAuthUser(SysUser sysUser);

    SysUser FindDistinctById(String id);

    SysUser FindDistinctByUsername(String username);

    Page<SysUser> FindPagedByFilters(String username, String displayname, String workno, String deptid, Pageable pageable);

    /**
     * Description //创建用户 自动创建密码
     * @author lijia
     * @Param user 用户实体类
     * @return com.lightjet.macross.base.upms.domain.SysUser
     * CreateTime 2020/3/9 10:56
     **/
    SysUser Create(SysUser user);

    /**
     * Description //根据筛选条件查询用户
     * @author lijia
     * @Param username 用户名
     * @param displayname 显示名称
     * @param email 邮件地址
     * @param mobile 移动电话
     * @return java.util.List<com.lightjet.macross.base.upms.domain.SysUser>
     * CreateTime 2020/3/9 10:57
     **/
    List<SysUser> FindByFilters(String username, String displayname, String email, String mobile);

    /**
     * Description //根据筛选条件查询通用用户
     * @author lijia
     * @Param username 用户名
     * @param keywords 关键字
     * @param pageable 分页信息
     * @return java.util.List<com.lightjet.macross.base.upms.domain.SysUser>
     * CreateTime 2020/3/9 10:57
     **/
    Page<SysUser> FindPageByKeyWords(String keywords,Pageable pageable);

}
